﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Load.aspx.cs" Inherits="Load" ValidateRequest="false" %>

<%
    if (Request.Form["htmltable"]!=null)
    {
        string fileName = Request.Form[1];//无需解码 Server.UrlDecode();
        string file = Request.Form["htmltable"];
       // Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName));
        int length = System.Text.ASCIIEncoding.UTF8.GetBytes(file).Length;
        Response.AddHeader("Content-Length", length.ToString());
        Response.ContentType = "application/application/octet-stream";
        
        Response.AddHeader("Content-disposition", "attachment; filename=" + fileName + ".xls");
        Response.Write(file);
    }

%>

